package com.zr.controller;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.zr.model.UserModel;
import com.zr.service.UserInfoService;

/**
 * 查询学生个人信息的调配者
 * @author 洪英杰
 *
 */
public class UserCheckInfoController extends HttpServlet{
	UserInfoService uis=new UserInfoService();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(req, resp);
	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		//从session中获取学生的学号
		HttpSession session=req.getSession();		
		UserModel user=(UserModel)session.getAttribute("usermodel");

		int sid=user.getSid();
		
		resp.setCharacterEncoding("utf8");
	
		//打印信息在页面相应的学生信息表
		PrintWriter pw=resp.getWriter();
		pw.write(uis.checkInfo(sid).toString());
		
	
	}

	
}
